using System.Collections.Generic;
using System.Linq;

namespace Pdf2epub.Model
{
    public class FontUsageCollection : List<FontUsage>
    {
        public bool Contains(string fontName, int fontsize)
        {
            fontName = FontUsage.GetFontName(fontName);
            return this.Any(fontUsage => (fontUsage.FontName == fontName) && (fontUsage.FontSize == fontsize));
        }

        public FontUsage Get(string fontName, int fontSize)
        {
            fontName = FontUsage.GetFontName(fontName);
            return this.FirstOrDefault(fontUsage => (fontUsage.FontName == fontName) && (fontUsage.FontSize == fontSize));
        }
    }
}